﻿using FriendStar.Code;
using FriendStar.Domain.Entity.WareHouse;
using FriendStar.Domain.IRepository.WareHouse;
using FriendStar.Repository.WareHouse;
using System.Collections.Generic;
using System.Linq;
using SqlSugarRepository;
using FriendStar.Application.SystemManage;
using FriendStar.Data;
using System;

namespace FriendStar.Application.WareHouse
{
    public class CPK_45_HZ_StoCPKListAccoApp
    {
        private ICPK_45_HZ_StoCPKListAccoRepository service = new CPK_45_HZ_StoCPKListAccoRepository();

        public List<CPK_45_HZ_StoCPKListAccoEntity> GetList()
        {
            return service.IQueryable().ToList();
        }
        public CPK_45_HZ_StoCPKListAccoEntity GetForm(string keyValue)
        {
            return service.FindEntity(keyValue);
        }
        public void DeleteForm(string keyValue)
        {
            service.Delete(p => p.FDocuListID == keyValue);
        }
        public void SubmitForm(CPK_45_HZ_StoCPKListAccoEntity CPK_45_HZ_StoCPKListAccoEntity, string keyValue)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                service.Update(CPK_45_HZ_StoCPKListAccoEntity);
            }
            else
            {
                service.Insert(CPK_45_HZ_StoCPKListAccoEntity);
            }
        }
    }
}

